<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="description" content="Metro, a sleek, intuitive, and powerful framework for faster and easier web development for Windows Metro Style.">
    <meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, metro, front-end, frontend, web development">
    <meta name="author" content="Sergey Pimenov and Metro UI CSS contributors">

    <link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />
    <title>Button groups :: Metro UI CSS - The front-end framework for developing projects on the web in Windows Metro Style</title>

    <link href="css/metro.css" rel="stylesheet">
    <link href="css/metro-icons.css" rel="stylesheet">
    <link href="css/metro-responsive.css" rel="stylesheet">
    <link href="css/metro-schemes.css" rel="stylesheet">

    <link href="css/docs.css" rel="stylesheet">

    <script src="js/jquery-2.1.3.min.js"></script>
    <script src="js/metro.js"></script>
    <script src="js/docs.js"></script>
    <script src="js/prettify/run_prettify.js"></script>
    <script src="js/ga.js"></script>
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>


    <style>
        .my-button-state {
            background: green;
            color: white;
        }
        .my-button-state:hover {
            background: lightgreen;
            color: #000000;
        }
        .my-button-state:active {
            background: darkgreen;
            color: #ffff00;
        }
        .my-button-state.active {
            background: red !important;
            color: #ffff00 !important;
        }
    </style>

</head>
<body>
    <div class="container page-content">
        <h1><a href="index.html" class="nav-button transform"><span></span></a>&nbsp;Button groups</h1>

        @@adsense

        <div class="example" data-text="example">
            <h5>Group type check (multi state)</h5>

            <div class="toolbar">
                <div class="toolbar-section condensed" data-role="group" data-group-type="multi-state">
                    <button class="toolbar-button">1</button>
                    <button class="toolbar-button active">2</button>
                    <button class="toolbar-button">3</button>
                    <button class="toolbar-button" disabled>4</button>
                </div>
                <div class="toolbar-section condensed" data-role="group" data-group-type="multi-state">
                    <button class="toolbar-button active"><span class="mif-facebook"></span></button>
                    <button class="toolbar-button"><span class="mif-twitter"></span></button>
                    <button class="toolbar-button active"><span class="mif-google-plus"></span></button>
                </div>
                <div class="toolbar-section" data-role="group" data-group-type="multi-state">
                    <button class="toolbar-button"><span class="mif-facebook"></span></button>
                    <button class="toolbar-button"><span class="mif-twitter"></span></button>
                    <button class="toolbar-button"><span class="mif-google-plus"></span></button>
                </div>
            </div>

            <h5>Group type radio (one state)</h5>

            <div class="toolbar">
                <div class="toolbar-section" data-role="group" data-group-type="one-state">
                    <button class="toolbar-button">1</button>
                    <button class="toolbar-button">2</button>
                    <button class="toolbar-button" disabled>3</button>
                    <button class="toolbar-button">4</button>
                </div>
                <div class="toolbar-section" data-role="group" data-group-type="one-state">
                    <button class="toolbar-button"><span class="mif-facebook"></span></button>
                    <button class="toolbar-button"><span class="mif-twitter"></span></button>
                    <button class="toolbar-button"><span class="mif-google-plus"></span></button>
                </div>
                <div class="toolbar-section" data-role="group" data-group-type="one-state">
                    <button class="toolbar-button"><span class="mif-facebook"></span></button>
                    <button class="toolbar-button"><span class="mif-twitter"></span></button>
                    <button class="toolbar-button"><span class="mif-google-plus"></span></button>
                </div>
            </div>

            <h5>Own style buttons</h5>
            <div class="toolbar-section condensed" data-role="group" data-group-type="multi-state" data-button-style="my-button-state">
                <button class="button">One</button>
                <button class="button active">Two</button>
                <button class="button">Three</button>
                <button class="button" disabled>Four</button>
            </div>

        </div>

        <div class="example" data-text="code">
            <h5>Declarative style</h5>
            <pre class="prettyprint linenums"><code>
                &lt;div data-role="group" data-group-type="multi-state" data-button-style="class"&gt;
                    &lt;button class="button"&gt;1&lt;/button&gt;
                    &lt;button class="button"&gt;2&lt;/button&gt;
                    &lt;button class="button"&gt;3&lt;/button&gt;
                &lt;/div&gt;

                &lt;div data-role="group" data-group-type="one-state"&gt;
                    &lt;button class="button"&gt;1&lt;/button&gt;
                    &lt;button class="button"&gt;2&lt;/button&gt;
                    &lt;button class="button"&gt;3&lt;/button&gt;
                &lt;/div&gt;
            </code></pre>

            <h5>JavaScript style</h5>
            <pre class="prettyprint linenums"><code>
                &lt;div id="button-group-1"&gt;
                    &lt;button class="button"&gt;1&lt;/button&gt;
                    &lt;button class="button"&gt;2&lt;/button&gt;
                    &lt;button class="button"&gt;3&lt;/button&gt;
                &lt;/div&gt;

                &lt;div id="button-group-2"&gt;
                    &lt;button class="button"&gt;1&lt;/button&gt;
                    &lt;button class="button"&gt;2&lt;/button&gt;
                    &lt;button class="button"&gt;3&lt;/button&gt;
                &lt;/div&gt;

                &lt;script&gt;
                    $(function(){
                        $("#button-group-1").group({
                            groupType: 'multi-state'
                        });

                        $("#button-group-2").group({
                            groupType: 'one-state'
                        });
                    });
                &lt;/script&gt;
            </code></pre>
        </div>

        <h3>Options</h3>
        <table class="table bordered border">
            <thead>
            <tr>
                <td>Parameter</td>
                <td>Data-*</td>
                <td>Type</td>
                <td>Default value</td>
                <td>Description</td>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>groupType</td>
                <td style="white-space: nowrap">data-group-type</td>
                <td>string</td>
                <td>one-state</td>
                <td>Type of group: one-state or multi-state</td>
            </tr>
            <tr>
                <td>buttonStyle</td>
                <td style="white-space: nowrap">data-button-style</td>
                <td>string</td>
                <td>false</td>
                <td>Class for own style of buttons</td>
            </tr>
            </tbody>
        </table>

        <h3>Events</h3>
        <table class="table bordered border">
            <thead>
            <tr>
                <td>Event</td>
                <td>Data-*</td>
                <td>Params</td>
                <td>Description</td>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>onChange</td>
                <td style="white-space: nowrap">data-on-change</td>
                <td>(index, button)</td>
                <td>The event fired before button is change status. If return false, state not changed</td>
            </tr>
            <tr>
                <td>onChanged</td>
                <td style="white-space: nowrap">data-on-change</td>
                <td>(index, button)</td>
                <td>The event fired after button change self status</td>
            </tr>
            </tbody>
        </table>
        <br />

    </div>

    @@hit

</body>
</html>